package com.wanxi.test;

import java.util.Scanner;

public class MyScanner {
    public static void main(String[] args) throws MyException {
//        Scanner scanner = new Scanner(System.in);

//        while (true) {
//            if (age > 25 || age < 18) {
//                throw new MyException("年龄应该在18-25之间");
//            } else {
//                System.out.println("输入正确");
//                break;
//            }
//        }
//        while (true) {
//            System.out.println("请输入年龄");
//            int age = 0;
//            try {
//                age = scanner.nextInt();
//                if (age > 25 || age < 18) {
////                    try {
////                        throw new MyException("年龄应该在18-25之间");
////                    } catch (Exception e) {
//                    System.out.println("年龄应该在18-25之间aaaa");
////                    }
//                } else {
//                    System.out.println("输入正确");
//                    break;
//                }
//            } catch (Exception e) {
//                System.out.println("请输入正整数");
//                try {
//                    int a = scanner.nextInt();
//                } catch (Exception a) {
//
//                }
//            }
        System.out.println(aa());  ;

    }

    public static int aa() {
        String a = null;
        int i=10/0;
        try {
//            System.exit(0);
            System.out.println(a.equals("a"));
            System.out.println("a");
            return 1;
        } catch (Exception e) {
            System.out.println("b");
            return 2;
        } finally {
            System.out.println("c");
        }
    }
}
